using System;
using System.Collections.Generic;
using System.Text;

using XNAF = Microsoft.Xna.Framework;

using xExt = XGAE.Framework.Extensions;

namespace XGAE.Framework.Backend
{
    /// <summary>
    /// Retrieve the state of the body by the queries with the game environment.
    /// </summary>
    public interface IPhysics
    {
        /// <summary>
        /// Did a collision with a static or dynamic obstacle occur?
        /// </summary>
        /// <param name="normal"></param>
        /// <returns></returns>
        bool IsCollision(XNAF.Vector3 normal);

        /// <summary>
        /// Check the presence of a platform beneath us.
        /// </summary>
        /// <returns></returns>
        Entity GetPlatform();

        /// <summary>
        /// Is the agent currently holding onto a ladder?
        /// </summary>
        /// <returns></returns>
        bool IsLadder();

        /// <summary>
        /// Are we in any kind of liquid?
        /// </summary>
        /// <returns></returns>
        bool IsWater();

        /// <summary>
        /// Check if the animat is touching the floor or not.
        /// </summary>
        /// <returns></returns>
        bool IsAir();

        /// <summary>
        /// Get the global location of the entity in the game world.
        /// </summary>
        /// <param name="position"></param>
        /// <param name="orientation"></param>
        void GetLocation(XNAF.Vector3 position, xExt.Angles orientation);
    }

    /// <summary>
    /// Get the global location of the entity in the game world.
    /// </summary>
    public class UpdateMessage : Message
    {
        XNAF.Vector3 _position; // Global coordinates of the animat.

        public XNAF.Vector3 Position
        {
            get { return this._position; }
        }

        xExt.Angles _orientation; // Global euler angles of the animat.

        public xExt.Angles Orientation
        {
            get { return this._orientation; }
        }

        public  UpdateMessage()
        :   base("Update")
        {}

        public UpdateMessage(XNAF.Vector3 position, xExt.Angles orientation)
        : base("Update")
        {
            this._position = position;
            this._orientation = orientation;
        }
    }
}
